#ifndef MYSERIALPORT_H
#define MYSERIALPORT_H

#include <QSerialPort>
#include <QWidget>

class MySerialPort
{
public:
    MySerialPort(){};
    static QSerialPort* open(QObject *parent, QString portname, int baudrate, QString &error);
    static void close(QSerialPort*);
    static void send(QSerialPort *serial, QByteArray &writtenData);
    static void sendAndRecv(QSerialPort *serial, QByteArray &writtenData, QByteArray &recvData, int &recvLen);
    static void recv(QSerialPort *serial, QByteArray &responseData, int &len);
private:
    QSerialPort *serial;
};

#endif // MYSERIALPORT_H
